//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Query Application Block
//===============================================================================

using System;
using Microsoft.Practices.EnterpriseLibrary.Configuration.Design;
using EntLibContrib.Query.Properties;

namespace EntLibContrib.Query.Configuration.Design
{
  /// <summary>
  /// Node map registrar for Data Queries
	/// this registers tree nodes with the configuration console
	/// and is used by the node builder to create the appropriate
	/// node type from the data type
	/// </summary>
  public class DataQueryNodeMapRegistrar: NodeMapRegistrar
  {
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="T:DataQueryNodeMapRegistrar"/> class.
		/// </summary>
		/// <param name="serviceProvider">The service provider.</param>
    public DataQueryNodeMapRegistrar(IServiceProvider serviceProvider) : base(serviceProvider)
    {
		}
		#endregion

		#region Public Methods
		/// <summary>
		/// Registers this instance.
		/// </summary>
    public override void Register()
    {
			AddMultipleNodeMap(InternalResources.DataCommandUICommandText,
												typeof(DataCommandNode),
												typeof(DataCustomCommandData));

			AddMultipleNodeMap(InternalResources.DataQueryUICommandText,
												typeof(DataQueryNode),
												typeof(DataQueryData));

			AddMultipleNodeMap(InternalResources.DataParameterUICommandText,
										typeof(DataParameterNode),
										typeof(DataParameterData));

			AddMultipleNodeMap(InternalResources.DataSetParameterUICommandText,
										typeof(DataSetParameterNode),
										typeof(DataSetParameterData));
		}
		#endregion
	}
}
